<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小红书图片生成器</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            display: flex;
            gap: 20px;
        }

        .control-panel {
            width: 300px;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .preview-container {
            flex: 1;
            border: 1px solid #ccc;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .canvas {
            width: 600px;
            height: 800px;
            background-color: #f0f0f0;
            position: relative;
        }

        .input-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        button {
            padding: 8px 12px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="control-panel">
        <div class="input-group">
            <label for="background-upload">上传背景图片 (JPG/PNG)</label>
            <input type="file" id="background-upload" accept=".jpg,.jpeg,.png">
        </div>
        
        <div class="input-group">
            <label for="text-input">输入文字内容</label>
            <textarea id="text-input" rows="5"></textarea>
        </div>

        <div class="input-group">
            <label for="font-select">选择字体</label>
            <select id="font-select">
                <option value="SimHei">黑体</option>
                <option value="KaiTi">楷体</option>
                <option value="Microsoft YaHei">微软雅黑</option>
            </select>
        </div>

        <div class="input-group">
            <label for="color-picker">文字颜色</label>
            <input type="color" id="color-picker" value="#ffffff">
        </div>

        <div class="input-group">
            <label for="font-size">字号调节</label>
            <input type="range" id="font-size" min="12" max="72" value="24">
            <span id="font-size-value">24px</span>
        </div>

        <button id="export-png">导出为PNG</button>
        <button id="export-jpg">导出为JPG</button>
    </div>

    <div class="preview-container">
        <canvas class="canvas" id="preview-canvas"></canvas>
    </div>

    <script src="script.js"></script>
</body>
</html>